package com.roamer.school.web.config;

import com.roamer.school.web.aspect.LoginUserArgumentResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * 自定义解析器配置
 *
 * @author roamer
 * @version V1.0
 * @date 2019/1/28 11:19
 */
@Configuration
public class CustomResolverConfig implements WebMvcConfigurer {

    /**
     * 添加参数解析器
     *
     * @param resolvers 参数解析器集合
     */
    @Override
    public void addArgumentResolvers(
            List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(new LoginUserArgumentResolver());
    }
}
